package nl.concipit.sheetmusicarchive.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;

/**
 * Entity representing a band member.
 * 
 * Each band member is member of 1 or more bands.
 * 
 * @author David
 */
@Entity
public class Member implements Serializable {
	/* Default value included to remove warning. */
	private static final long serialVersionUID = 1L;

	/**
	 * Unique identifier
	 */
	@Id
	@GeneratedValue
	private Long id;

	/**
	 * First name
	 */
	@NotNull
	private String firstName;

	/**
	 * Last name
	 */
	@NotNull
	private String lastName;

	/**
	 * Link to information regarding the bands to which this member is 
	 * associated
	 */
	@OneToMany(mappedBy = "member")
	private List<BandMember> bandMember;

	/**
	 * Returns the ID
	 * 
	 * @return unique member ID
	 */
	public Long getId() {
		return id;
	}

	/**
	 * Sets the ID
	 * 
	 * @param id
	 *            ID to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * Returns first name
	 * 
	 * @return First name
	 */
	public String getFirstName() {
		return firstName;
	}

	/**
	 * Sets the first name
	 * 
	 * @param firstName
	 *            First name to set
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 * Returns the last name
	 * 
	 * @return Last name
	 */
	public String getLastName() {
		return lastName;
	}

	/**
	 * Sets the last name
	 * 
	 * @param lastName
	 *            Last name to set
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	/**
	 * Returns the information regarding the bands to which this member is
	 * associated
	 * 
	 * @return the bandMember
	 */
	public List<BandMember> getBandMember() {
		return bandMember;
	}

	/**
	 * Sets information regarding the bands to which this member is associated
	 * 
	 * @param bandMember
	 *            the bandMember to set
	 */
	public void setBandMember(List<BandMember> bandMember) {
		this.bandMember = bandMember;
	}
}